#ifndef __DEF_H__
#define __DEF_H__

/**
 * RT-Thread basic data type definitions
 */
typedef signed 	 char  					rt_int8_t;		/**<  8bit integer type */
typedef signed 	 short 					rt_int16_t;		/**< 16bit integer type */
typedef signed 	 long  					rt_int32_t;		/**< 32bit integer type */
typedef unsigned char  					rt_uint8_t;		/**<  8bit unsigned integer type */
typedef unsigned short 					rt_uint16_t;	/**< 16bit unsigned integer type */
typedef unsigned long  					rt_uint32_t;	/**< 32bit unsigned integer type */
typedef int 							rt_bool_t;		/**< boolean type */

/* 32bit CPU */
typedef long 							rt_base_t;		/**< Nbit CPU related date type */
typedef unsigned long 					rt_ubase_t;		/**< Nbit unsigned CPU related data type */

typedef rt_base_t						rt_err_t;		/**< Type for error number		*/
typedef rt_uint32_t						rt_time_t;		/**< Type for time stamp 		*/
typedef rt_uint32_t						rt_tick_t;		/**< Type for tick count 		*/
typedef rt_base_t						rt_flag_t;		/**< Type for flags 			*/
typedef rt_ubase_t						rt_size_t;		/**< Type for size number		*/
typedef rt_ubase_t						rt_dev_t;		/**< Type for device			*/
typedef rt_uint32_t						rt_off_t;		/**< Type for offset			*/

/**
 * boolean type definitions
 */
#define RT_TRUE 						1	/**< boolean true  */
#define RT_FALSE 						0	/**< boolean fails */
/*@}*/

/* maximun value of base type 			*/
#define RT_UINT8_MAX					0xff			/* Maxium number of UINT8.					*/
#define RT_UINT16_MAX					0xffff			/* Maxium number of UINT16.					*/
#define RT_UINT32_MAX					0xffffffff		/* Maxium number of UINT32.					*/
#define RT_TICK_MAX						RT_UINT32_MAX	/* Maxium number of tick                    */



#endif
